﻿@model ContactManagement.Models.GroupRightListModel
@{
    ViewBag.Title = GlobalResources.PageTitles.GroupRightsManagementRESX + ": " + Model.CurrentGroup.Name;
}

<div class="span12">
    <h2>@GlobalResources.PageTitles.GroupRightsManagementRESX: @Model.CurrentGroup.Name</h2>
    <hr />
    @Html.ShowCustomMessage()
    <div class="well"><h4>@GlobalResources.AdminViews.AssignedUserRightsRESX (@Model.HasUserRight.Count())</h4></div>
</div>

<div class="span12">
    @if (!Model.HasUserRight.Any())
    {
        @GlobalResources.AdminViews.NoRightsFoundRESX;
    }
    else
    {
        @:<table class="table table-striped @WebConstants.FilterTableRowsCssClass">
            <thead>
                <tr>
                    <th>
                        @GlobalResources.AccountViews.OptionsRESX
                    </th>
                    <th>
                        @Html.TableHeaderLinks("Name", GlobalResources.PageTitles.UserRightRESX).CreateSortLink()
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var eRight in Model.HasUserRight)
                {
                    <tr>
                        <td>@* Den Link erstellen für das Löschen des Rechts aus der Gruppe, wichtig ist das in der URL die rightId sowie die GroupId steht für die die Aktion durchgeführt werden soll *@
                            @Html.RouteLink(GlobalResources.Navigation.DeleteUserRightRESX, RouteNames.Categories.ToString(),
                          new { controller = EControllers.Administration.ToString(), category = EFCategoryTypes.UserGroups.ToString(), action = EActionAdministration.UserGroupsShowRightsDelete.ToString(), id = Model.CurrentGroup.ID, rightId = eRight.ID }, new { @class = "btn btn-small", data_icon="icon-minus" })
                        </td>
                        <td>
                            @eRight.GetRightName()
                        </td>
                    </tr>
                }
            </tbody>
        @:</table>
    }
</div>

<div class="span12">&nbsp;</div>

<div class="span12">
    <div class="well"><h4>@GlobalResources.AdminViews.NotAssignedUserRightsRESX (@Model.HasNoUserRight.Count())</h4></div>
</div>


<div class="span12">
    @if (!Model.HasNoUserRight.Any())
    {
        @GlobalResources.AdminViews.NoRightsFoundRESX;
    }
    else
    {
        @:<table class="table table-striped @WebConstants.FilterTableRowsCssClass">
            <thead>
                <tr>
                    <th>
                        @GlobalResources.AccountViews.OptionsRESX
                    </th>
                    <th>
                        @Html.TableHeaderLinks("Name", GlobalResources.PageTitles.UserRightRESX).CreateSortLink()
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var eRight in Model.HasNoUserRight)
                {
                    <tr>
                        <td>@* Den Link erstellen für das Hinzufügen des Rechts zu der Gruppe, wichtig ist das in der URL die rightId sowie die GroupId steht für die die Aktion durchgeführt werden soll *@
                            @Html.RouteLink(GlobalResources.Navigation.AddUserRightRESX, RouteNames.Categories.ToString(),
                         new { controller = EControllers.Administration.ToString(), category = EFCategoryTypes.UserGroups.ToString(), action = EActionAdministration.UserGroupsShowRightsAdd.ToString(), id = Model.CurrentGroup.ID, rightId = eRight.ID }, new { @class = "btn btn-small", data_icon="icon-plus" })
                        </td>
                        <td>
                            @eRight.GetRightName()
                        </td>
                    </tr>
                }
            </tbody>
        @:</table>
    }
</div>

<div class="span12">
    <div class="well">
        @Html.RouteLink(GlobalResources.Navigation.BackToListRESX, RouteNames.Categories.ToString(), new { controller = EControllers.Administration.ToString(), category = EFCategoryTypes.UserGroups.ToString(), action = EActionAdministration.CategoriesList.ToString() }, new { @class = "btn btn-small", data_icon = "icon-arrow-left"} )
    </div>
</div>

